@import './globalAntd.less';

body {
  width: 100%;
  color: var(--font);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

canvas {
  display: block;
}

ul,
ol {
  list-style: none;
}

::-webkit-scrollbar {
  width: 6px !important;
  height: 6px !important;
}
::-moz-scrollbar {
  width: 6px !important;
  height: 6px !important;
}

::-webkit-scrollbar-track {
  background: transparent !important;
}

::-webkit-scrollbar-thumb {
  background: var(--bg-scroll) !important;
  border-radius: 5px !important;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--bg-scroll) !important;
}

* {
  /* Firefox浏览器 */
  scrollbar-width: thin;
  scrollbar-color: var(--bg-scroll) transparent !important;
}

#root-master {
  .ant-layout-sider {
    ::-webkit-scrollbar-thumb {
      background: rgba(172, 177, 193, 0.5) !important;
    }
    * {
      scrollbar-width: thin;
      scrollbar-color: rgba(172, 177, 193, 0.5) transparent !important;
    }
  }
}
// 侧边栏不变
.ant-menu-submenu-popup {
  background: rgba(172, 177, 193, 0.5) !important;
  * {
    scrollbar-width: thin;
    scrollbar-color: rgba(172, 177, 193, 0.5) transparent !important;
  }
}

html {
  .ant-layout:not(#trscreen) {
    color: var(--font);
    background: var(--bg-base);
    .ant-layout-content {
      background: var(--bg);
    }
  }
  // 大屏项目颜色写死，不为黑
  .ant-layout:has(#trscreen) {
    color: #fafafa;
    background-color: transparent;
  }
  .ReactVirtualized__List:focus {
    outline: none;
  }

  .so-tree-no-line .so-tree-icon-plus:hover::after,
  .so-tree-no-line .so-tree-icon-sub:hover::after {
    background: var(--bg-weak3);
  }

  // art table styles
  .art-table-cell,
  .art-table-row,
  .art-table {
    th,
    td {
      color: var(--font-a80);
      // border-top: 1px solid var(--bd-a50) !important;
    }
    // td:first-child,
    // th:first-child {
    //   border-left: 1px solid var(--bd-a50) !important;
    // }
    // td:last-child,
    // th:last-child {
    //   border-right: 1px solid var(--bd-a50) !important;
    // }
  }
  .art-table {
    tr,
    th,
    td {
      border-color: var(--bd-a50) !important;
    }
    .art-table-body,
    .art-table-footer {
      background-color: transparent;
    }
  }
  .art-table-row:nth-child(even) {
    .art-table-cell {
      background-color: var(--ant-cus-bg_table_even_td) !important;
    }
  }
  .art-table-row:nth-child(odd) {
    .art-table-cell {
      background-color: var(--ant-cus-bg_table_odd_td) !important;
    }
  }
  .art-table-header-row,
  .art-table-header-cell {
    color: var(--font);
    background-color: var(--ant-cus-bg_table_tr) !important;
  }
  .w-e-toolbar,
  .w-e-text-container,
  .w-e-menu-panel {
    background-color: var(--bg-main);
  }
  input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px transparent inset;
    -webkit-text-fill-color: var(--font);
  }

  input:-webkit-autofill:hover,
  input:-webkit-autofill:focus,
  input:-webkit-autofill:active {
    transition: background-color 5000s ease-in-out 0s;
    -webkit-text-fill-color: var(--font);
  }
}

.ant-tree-list-scrollbar {
  .ant-tree-list-scrollbar-thumb {
    background-color: var(--bg-scroll) !important;
  }
}

/*  ai  */
#fastgpt-chatbot-button,
#fastgpt-chatbot-window {
  display: none !important;
}

#fastgpt-chatbot-window {
  width: 920px !important;
  border-radius: 16px !important;
}

#fastgpt-chatbot-button {
  position: relative;
  transition: transform 0.2s ease;
  -webkit-user-select: none;
  -ms-user-select: none;
  -moz-user-select: none;
  user-select: none;

  img {
    filter: drop-shadow(0 4px 3px var(--ant-cus-base_shadow))
      drop-shadow(0 6px 8px var(--ant-cus-base_shadow5));
    transition: filter 0.3s ease, transform 0.2s ease;
  }
  & > .eye {
    position: absolute;
    top: 50%;
    right: 22px;
    width: 10px;
    height: 10px;
    background-color: #0c175e;
    border-radius: 50%;
    transform: translateY(-50%);
    animation: blink 4s infinite cubic-bezier(0.4, 0.1, 0.6, 1);
    &:nth-child(2) {
      right: 9px;
    }
  }

  &:hover img {
    transform: scale(1.05);
    filter: drop-shadow(0 6px 5px var(--ant-cus-base_shadow2))
      drop-shadow(0 10px 12px var(--ant-cus-base_shadow5));
  }

  &:active img {
    transform: scale(0.95);
    filter: drop-shadow(0 2px 2px var(--ant-cus-base_shadow5))
      drop-shadow(0 4px 6px var(--ant-cus-base_shadow4));
  }

  &::before {
    position: absolute;
    top: 50%;
    left: 50%;
    color: var(--font-primary);
    font-size: 16px;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: opacity 0.2s ease;
    content: '💡';
  }
  &:hover::before {
    animation: fly-across 1.2s linear;
  }
}

@keyframes fly-across {
  0% {
    transform: translate(-50%, -50%) scale(1) rotate(0) translateX(15px) translateY(-10px);
    opacity: 1;
  }
  30% {
    transform: translate(-50%, -50%) scale(1.3) rotate(20deg) translateX(35px) translateY(-40px);
  }
  60% {
    transform: translate(-50%, -50%) scale(1) rotate(10deg) translateX(95px) translateY(-30px);
  }
  100% {
    transform: translate(-50%, -50%) scale(0.8) rotate(-10deg) translateX(120px) translateY(-5px);
    opacity: 0;
  }
}
@keyframes blink {
  0%,
  90% {
    opacity: 0;
  }
  92% {
    opacity: 1;
  }
  94% {
    opacity: 0;
  }
  96% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
